/*
**  Copyright (C), CHENGDU GONGWEI TECHNOLOGY CO.,LTD.
**
**  Project:	Manager Unit v1.0
**  File:    	
**  Author: 	zhaozhuyu
**  Date:    	2017/05/20
**
**  Purpose:
**    		.
**
**  History: 
**  <author>   <time>          <version >   <desc>
*	$$Author$$
*/


#ifndef __OBJECT_H__
#define __OBJECT_H__


/* Include files. */
#include "cplusplus.h"
#include "debug.h"

/* Macro constant definitions. */

/* Type definitions. */

/* External variable declarations. */

/* External function declarations. */

/* Macro API definitions. */

class ref;
class object
{
public:
	object(string name, string alias, string subname, lua_State *L);
	virtual ~object();

	static map<string, object*> object_map_mgr;
	static object* findObject(string key);
	map<string, ref*> _ref_map_mgr;
	ref* findRef(string key);
	int add(ref *r);
	int remove(string key);

public:
	string _name;
	string _alias;
	string _subname;
	lua_State *_L;
};

int luaregObject(lua_State *L); 
int luaunRegObject(lua_State *L);
int luagetObjectName(lua_State *L); 
int luagetObject(lua_State *L); 
int luagetAllObject(lua_State *L); 



#endif

